<template>
  <el-table
    border
    :data="signList"
  >
    <el-table-column
      label="序号"
      type="index"
      width="60"
      align="center"
    />
    <el-table-column
      label="批号"
      prop="batchNumber"
      width="100"
      align="center"
    />
    <el-table-column label="真方位（C°）" prop="trueOrientation" align="center" />
    <el-table-column
      label="机方位（C°）"
      prop="machineOrientation"
      align="center"
      width="120"
    />
    <el-table-column label="更新次数" prop="updateNumber" align="center" />
    <el-table-column label="幅度" prop="amplitude" align="center" />
    <el-table-column
      label="载频（MHz）"
      prop="carryFre"
      align="center"
      width="120"
    />
    <el-table-column label="载频类型" prop="carryFreType" align="center" />
    <el-table-column label="重周" prop="cz" align="center" />
    <el-table-column label="重周类型" prop="czType" align="center" />
    <el-table-column label="脉宽" prop="pulseWidth" align="center" />
    <el-table-column label="脉宽类型" prop="pwmType" align="center" />
    <el-table-column label="可信度" prop="reliability" align="center" />
    <el-table-column label="出现时间" prop="startTime" align="center" />
    <el-table-column label="更新时间" prop="updateTime" align="center" />
    <el-table-column
      label="操作"
      width="120"
      align="center"
      fixed="right"
    >
      <template #default="{ row }">
        <el-button class="mt-2" size="small" @click="analyse(row)">分析</el-button>
        <el-button class="mt-2" size="small" @click="findDirection(row)">测向</el-button>
      </template>
    </el-table-column>
  </el-table>
  <div class="scantabs">
    <div
      v-for="item in spectrumList"
      :key="item.key"
      :class="{ 'active' : activeKey === item.key }"
      class="st-item"
      @click="activeKey = item.key"
    >
      {{ item.value }}
    </div>
  </div>  
</template>

<script setup>
const props = defineProps({
  signList: {
    type: Array,
    default: () => [
      { updateNumber: 100, batchNumber: 100, amplitude: -80 },
      { updateNumber: 100, batchNumber: 101, amplitude: -80 },
      { updateNumber: 100, batchNumber: 102, amplitude: -80 },
      { updateNumber: 100, batchNumber: 103, amplitude: -80 },
      { updateNumber: 100, batchNumber: 104, amplitude: -80 },
    ]
  }
})
const analyse = () => {}
const findDirection = () => {}
const spectrumList = [
  { value: '已知雷达', key: 0 },
  { value: '未知雷达', key: 1 },
]
const activeKey = ref(0)
</script>